<#include "/common/_layout.html">
<#assign pageJavascript>
<script type="text/javascript" src="/assets/rabbit/jquery.imgup.js"></script>
<script type="text/javascript">
$(function(){
	$("#form1").Validform({
		tiptype:5,
		beforeSubmit:function(curform){
			var para = $(curform).serializeObject();
			$.extend(para,{"UserClient.id":"${(UserClient.id)!}"});
			var loadIndex = layer.load();
			$.post("/admin/system/client/save?v="+Math.random(),para,function(data){
	           if (data.msg == 'success') {
	        	   layer.alert('保存成功！',{icon: 6},function(index){
	        		   layer.close(index);
	        		   window.location="/admin/system/client";
	        	   });
	           }
		       else {layer.msg('保存失败！', {icon: 5});}
	           layer.close(loadIndex);
			});
			return false;	
		}
	});
	$("#imgbtn").click(function(){
		alert($(".imgbb").imgup('getImgs'));
	});
	$(".imgbb").imgup({muti:true,imgs:[]});
	//$(".imgbb").imgup({imgs:['http://img.wxfenxiao.com/aa/c5/2016-04/5715db41ce023.png','http://img.wxfenxiao.com/aa/c5/2016-04/5715db410ef11.png','http://img.wxfenxiao.com/aa/c5/2016-04/5715db41ce023.png','http://img.wxfenxiao.com/aa/c5/2016-04/5715db41ce023.png']});
});
</script>
</#assign>
<@layout pageTitle="编辑客户资料" pageJavascript=pageJavascript pageCss=pageCss>	
<h3 class="page-header">编辑客户资料</h3>	
<form id = "form1" class="form-horizontal">
  <div class="form-group">
    <label for="username" class="col-sm-2 control-label">客户名称</label>
    <div class="col-xs-10 col-sm-3">
      <input type="text" id="username" value="${(UserClient.username)!}" name="username" datatype="s2-20" class="form-control">
    </div>
  </div> 
  <div class="form-group">
    <label for="sex" class="col-sm-2 control-label">性别</label>
    <div class="col-xs-10 col-sm-3">
      	    	<select name="UserClient.sex" id="sex" class="form-control">
      	    	<#if UserClient??>
      	    	<option id="sex" value="${(UserClient.sex)!}">${(sexcontent)!}</option>
      	    	</#if>
			      <option value="1">男</option>
			      <option value="2">女</option>
			 </select>
    </div>
  </div>
    <div class="form-group">
    <label for="age" class="col-sm-2 control-label">生日</label>
    <div class="col-xs-10 col-sm-3">
      <!-- <input type="number" id="age" value="${(UserClient.age)!}" name="age" datatype="s2-20" class="form-control"> -->
      <input class="form-control" value="${(UserClient.birthday)!}" style="width:160px" onFocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="input" data-rule="ge" id="birthday" name="birthday">
    </div>
  </div>
    <div class="form-group">
    <label for="medal" class="col-sm-2 control-label">勋章等级</label>
    <div class="col-xs-10 col-sm-3">
      <input class="form-control"<#if UserClient ??>disabled</#if> value="${(UserClient.medal)!}" style="width:160px" type="input"  id="medal" name="medal">
    </div>
  </div>
    <div class="form-group">
    <label for="phone" class="col-sm-2 control-label">手机号码</label>
    <div class="col-xs-10 col-sm-3">
      <input type="number" id="phone" value="${(UserClient.phone)!}" name="phone" datatype="m" class="form-control">
    </div>
  </div>
    <div class="form-group">
    <label for="address" class="col-sm-2 control-label">地址</label>
    <div class="col-xs-10 col-sm-3">
    <textarea id="address" rows="8" cols="20" name="address" datatype="*0-200"  class="form-control">${(UserClient.address)!}</textarea>
    </div>
  </div>
    <div class="form-group">
    <label for="remark" class="col-sm-2 control-label">上传头像</label>
    <div class="col-xs-10 col-sm-5 j-imglistPanel">
        <input type="hidden" name="imgurl" id="imgurl" class="imgbb" value="${(UserClient.imgurl)!}">
        <p class="help-block">建议上传尺寸640px * 640px</p>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
       <button id="imgbtn" type="button" class="btn">图片</button>
      <button type="submit" class="btn btn-success">提交</button>
      <a href="/admin/system/client" class="btn btn-default">取消</a>
    </div>
  </div>
</form>
</@layout>